package edu.jmu.bean.system;



import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import edu.jmu.bean.user.User;
/**
 * 登陆日志
 * @author Neal
 *
 */
@Entity
public class LoginLog implements Serializable{
	private static final long serialVersionUID = 1L;
	/**	ID	**/
	private Integer id;
	/**	用户	**/
	private User user;
	/**	登陆时间	**/
	private Date loginTime = new Date();
	/**	登陆是否成功	**/
	private boolean isSuccess;
	/**	登陆IP	**/
	private String loginUserIp;
	/**	登陆备注	**/
	private String loginDesc;
	
	@Id	@GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	@ManyToOne(cascade=CascadeType.REFRESH)
	@JoinColumn(name="user_Id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	@Temporal(TemporalType.TIMESTAMP)
	public Date getLoginTime() {
		return loginTime;
	}
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	@Column(length=1)
	public boolean isSuccess() {
		return isSuccess;
	}
	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}
	@Column(length=64)
	public String getLoginUserIp() {
		return loginUserIp;
	}
	public void setLoginUserIp(String loginUserIp) {
		this.loginUserIp = loginUserIp;
	}
	@Column(length=100)
	public String getLoginDesc() {
		return loginDesc;
	}
	public void setLoginDesc(String loginDesc) {
		this.loginDesc = loginDesc;
	}
	
}
